import { ILabTypeQuery, ILabTypeUpdate } from "../RequestIDL/labType";
import createReq from "../request";
import { ContentType, Method } from "../type";

// 实验室类型 获取
export const getAllLabType = () => {
  return createReq({ method: Method.GET, url: "labtype/all" });
};
// 所有实验室人员获取
export const getAllLabMan = () => {
  return createReq({
    method: Method.GET,
    url: "/user/experimenters",
    contentType: ContentType.Multipart,
  });
};
// 实验室类型分页查询
export const getLabeTypeList = (data: ILabTypeQuery) => {
  return createReq({
    method: Method.POST,
    url: "/labtype/searchByNamePage",
    data,
  });
};
// 删除
export const deleteLabeType = (data: { id: number }) => {
  return createReq({
    method: Method.POST,
    url: "/labtype/delete",
    data,
  });
};
// 修改 labtype/update
export const updateLabeType = (data: ILabTypeUpdate) => {
  return createReq({
    method: Method.POST,
    url: "/labtype/update",
    data,
  });
};
// 新增实验室类型
export const createLabeType = (data: Partial<ILabTypeUpdate>) => {
  return createReq({
    method: Method.POST,
    url: "/labtype/add",
    data,
  });
};
